package com.hnichr.ump.common.plan.entity;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.hnichr.ump.common.entity.UmpEntity;
import com.mxpioframework.jpa.annotation.Generator;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.EqualsAndHashCode;

import javax.persistence.*;
import java.math.BigDecimal;
import java.util.Date;
import java.util.List;


@Data
@EqualsAndHashCode(callSuper=false)
@Entity
@Table(name = "t_plan_schedule_content")
@Schema(description = "重点工作分项表")
public class PlanScheduleContents extends UmpEntity {
    @Id
    @Generator
    @Column(name = "ID_", updatable = false,length = 64)
    @Schema(description = "ID")
    private String id;

    @Schema(description = "重点工作表ID")
    @Column(name = "SCHEDULES_ID_",length = 64)
    private String schedulesId;

    @Column(name = "START_TIME_")
    @Schema(description = "开始时间")
    @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
    private Date startTime;

    @Column(name = "END_TIME_")
    @Schema(description = "结束时间")
    @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
    private Date endTime;

    @Column(name = "USERNAME_", length = 64)
    @Schema(description = "创建计划用户名")
    private String username;

    @Column(name = "NICKNAME_", length = 64)
    @Schema(description = "创建计划昵称")
    private String nickname;

    @Schema(description = "内容")
    @Column(name = "CONTENT_",length = 1024)
    private String content;

    @Column(name = "PROGRESS_")
    @Schema(description = "计划进度")
    private BigDecimal progress;

    @Column(name = "STATUS_", length = 1)
    @Schema(description = "是否完成 0-未完成 1-已完成")
    private String status="0";

    @Transient
    @Schema(description = "部门")
    private List<PlanScheduleContentDept> deptList;
}
